#include once "mud-gui/widgets/CustomLayout.bi"

namespace ui


        constructor CustomLayout ( byval parent as BaseWidget ptr = 0 )

        if parent <> 0 then
                if parent->cl <> layout_t.noLayout then
                        SetParent(parent)
                else
                        ShowError("Cannot insert GridLayout into this widget.")
                end if
        end if

        end constructor

        property CustomLayout.xPos( )as integer

        return (BaseObject).x

        end property
        
        property CustomLayout.setXpos( byval _t_ as integer )

        (BaseObject).x = _t_

        end property
        
        property CustomLayout.yPos( ) as integer

        return (BaseObject).y

        end property

        property CustomLayout.setYpos( byval _t_ as integer )

        (BaseObject).y = _t_

        end property

        property CustomLayout.width( ) as integer

        return (BaseObject).width

        end property

        property CustomLayout.setWidth( byval _t_ as integer )

        (BaseObject).width = _t_

        end property
        
        property CustomLayout.height( ) as integer

        return (BaseObject).height

        end property

        property CustomLayout.setHeight( byval _t_ as integer )

        (BaseObject).height = _t_

        end property

        sub CustomLayout.PlaceWidget( byval wid as BaseWidget ptr, byval _x as integer, byval _y as integer, _
                byval width_ as integer, byval height_ as integer )

                if wid = 0 then return

                wid->x = _x
                wid->y = _y
                wid->width = width_
                wid->height = height_
                (BaseObject).addChild( wid )

        end sub

end namespace
